﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using MF.BO.Objects;
using MF.BL.Core;

namespace MF.WCF.Core
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "MFTransaction" in code, svc and config file together.
    public class MFTransaction : IMFTransaction
    {
        public List<TransactionItem> GetAllTransaction()
        {
            List<TransactionItem> toReturn = new List<TransactionItem>();

            try
            {
                toReturn = BusinessUtils.TransactionService.GetAllTransaction();
            }
            catch (Exception Ex)
            {
                throw Ex;

            }

            return toReturn;
        }

        public int Insert(TransactionItem toInsert)
        {
            int toReturn = 0;

            try
            {
                toReturn = BusinessUtils.TransactionService.Insert(toInsert);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return toReturn;
        }

        public int Update(TransactionItem toUpdate)
        {
            int toReturn = 0;

            try
            {
                toReturn = BusinessUtils.TransactionService.Update(toUpdate);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return toReturn;
        }

        public int Delete(int idToDelete)
        {
            int toReturn = 0;

            try
            {
                toReturn = BusinessUtils.TransactionService.Delete(idToDelete);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return toReturn;
        }
    }
}
